Integrand size = 18, antiderivative size = 133 \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 x^4}{4}-\frac {2 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {b^2 \log \left (\cos \left (c+d x^2\right )\right )}{2 d^2}+\frac {i a b \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {i a b \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )}{d^2}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{2 d} \]
[Out]
Time = 0.20 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.389, Rules used = {4289, 4275, 4266, 2317, 2438, 4269, 3556} \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 x^4}{4}-\frac {2 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {i a b \operatorname {PolyLog}\left (2,-i e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {i a b \operatorname {PolyLog}\left (2,i e^{i \left (d x^2+c\right )}\right )}{d^2}+\frac {b^2 \log \left (\cos \left (c+d x^2\right )\right )}{2 d^2}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{2 d} \]
[In]
[Out]
Rule 2317
Rule 2438
Rule 3556
Rule 4266
Rule 4269
Rule 4275
Rule 4289
Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \text {Subst}\left (\int x (a+b \sec (c+d x))^2 \, dx,x,x^2\right ) \\ & = \frac {1}{2} \text {Subst}\left (\int \left (a^2 x+2 a b x \sec (c+d x)+b^2 x \sec ^2(c+d x)\right ) \, dx,x,x^2\right ) \\ & = \frac {a^2 x^4}{4}+(a b) \text {Subst}\left (\int x \sec (c+d x) \, dx,x,x^2\right )+\frac {1}{2} b^2 \text {Subst}\left (\int x \sec ^2(c+d x) \, dx,x,x^2\right ) \\ & = \frac {a^2 x^4}{4}-\frac {2 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{2 d}-\frac {(a b) \text {Subst}\left (\int \log \left (1-i e^{i (c+d x)}\right ) \, dx,x,x^2\right )}{d}+\frac {(a b) \text {Subst}\left (\int \log \left (1+i e^{i (c+d x)}\right ) \, dx,x,x^2\right )}{d}-\frac {b^2 \text {Subst}\left (\int \tan (c+d x) \, dx,x,x^2\right )}{2 d} \\ & = \frac {a^2 x^4}{4}-\frac {2 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {b^2 \log \left (\cos \left (c+d x^2\right )\right )}{2 d^2}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{2 d}+\frac {(i a b) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {(i a b) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{i \left (c+d x^2\right )}\right )}{d^2} \\ & = \frac {a^2 x^4}{4}-\frac {2 i a b x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {b^2 \log \left (\cos \left (c+d x^2\right )\right )}{2 d^2}+\frac {i a b \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {i a b \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )}{d^2}+\frac {b^2 x^2 \tan \left (c+d x^2\right )}{2 d} \\ \end{align*}
Time = 0.53 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.92 \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 d^2 x^4-8 i a b d x^2 \arctan \left (e^{i \left (c+d x^2\right )}\right )+2 b^2 \log \left (\cos \left (c+d x^2\right )\right )+4 i a b \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^2\right )}\right )-4 i a b \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^2\right )}\right )+2 b^2 d x^2 \tan \left (c+d x^2\right )}{4 d^2} \]
[In]
[Out]
\[\int x^{3} {\left (a +b \sec \left (d \,x^{2}+c \right )\right )}^{2}d x\]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 525 vs. \(2 (109) = 218\).
Time = 0.33 (sec) , antiderivative size = 525, normalized size of antiderivative = 3.95 \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\frac {a^{2} d^{2} x^{4} \cos \left (d x^{2} + c\right ) + 2 \, b^{2} d x^{2} \sin \left (d x^{2} + c\right ) - 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) - 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) + 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right )\right ) + 2 i \, a b \cos \left (d x^{2} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right )\right ) - {\left (2 \, a b c - b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + i\right ) + {\left (2 \, a b c + b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + i\right ) + 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right ) + 1\right ) - 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right ) + 1\right ) + 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (-i \, \cos \left (d x^{2} + c\right ) + \sin \left (d x^{2} + c\right ) + 1\right ) - 2 \, {\left (a b d x^{2} + a b c\right )} \cos \left (d x^{2} + c\right ) \log \left (-i \, \cos \left (d x^{2} + c\right ) - \sin \left (d x^{2} + c\right ) + 1\right ) - {\left (2 \, a b c - b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (-\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + i\right ) + {\left (2 \, a b c + b^{2}\right )} \cos \left (d x^{2} + c\right ) \log \left (-\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + i\right )}{4 \, d^{2} \cos \left (d x^{2} + c\right )} \]
[In]
[Out]
\[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int x^{3} \left (a + b \sec {\left (c + d x^{2} \right )}\right )^{2}\, dx \]
[In]
[Out]
\[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int { {\left (b \sec \left (d x^{2} + c\right ) + a\right )}^{2} x^{3} \,d x } \]
[In]
[Out]
\[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int { {\left (b \sec \left (d x^{2} + c\right ) + a\right )}^{2} x^{3} \,d x } \]
[In]
[Out]
Timed out. \[ \int x^3 \left (a+b \sec \left (c+d x^2\right )\right )^2 \, dx=\int x^3\,{\left (a+\frac {b}{\cos \left (d\,x^2+c\right )}\right )}^2 \,d x \]
[In]
[Out]